<?php
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'basic';
$return=array();
if($_RQ['op']=='basic'){
	if($_RQ['postdata']){
		$postdata=get_postdata();
		$this->plugin_setting('basic',$postdata);
		exi('设置成功');
	}
	$return['item']=$this->plugin_setting('basic');
	$return['item']['shopcommission_type']=$return['item']['shopcommission_type']?:'0';
	$return['item']['commission_type']=$return['item']['commission_type']?:'0';
	$return['item']['url']=custom_url('jy_chengedu/manage.login/',true);
	$return['item']['plugins']=$return['item']['plugins']?$return['item']['plugins']:$plugins[1]['list'];
	$return['item']['myshop_tpl']=$return['item']['myshop_tpl']?:0;
	$htmls=array(
		'type'=>'edit',
		'desc'=>'参数设置',
		
		'edit_tab'=>true,
		'edits'=>array(
			array(
				'title'=>'基础设置',
				'list'=>array(
					array('type'=>'switch','title'=>'是否开启机构','name'=>'open'),
					array('type'=>'switch','title'=>'是否开启审核','name'=>'isshenhe','help'=>'开启审核后，机构申请，机构发布的商品都需要审核！'),
					array('type'=>'switch','title'=>'是否需要缴纳入驻金','name'=>'yajin_open','help'=>'开启后，需缴纳入驻金才能开店！！'),
					array('type'=>'unitstring','name'=>'yajin','unit'=>'元','title'=>'机构缴纳入驻金','help'=>'机构开店需缴纳的入驻金！'),
				)
			),
			array(
				'title'=>'幻灯片',
					'list'=>array(
						array(
							'type'=>'array',
							'name'=>'hdps',
							'add_tip'=>'添加一个幻灯片',
								'list'=>array(
									array('type'=>'image','name'=>'picurl','title'=>'幻灯片图片'),
									array('type'=>'string','name'=>'url','title'=>'幻灯片链接'),
									
								),
								'details'=>array(
									array('type'=>'image','name'=>'picurl','title'=>'幻灯片图片','help'=>'建议尺寸：高360px*宽640px'),
									array('type'=>'link','name'=>'url','from'=>'action','title'=>'幻灯片链接'),
									
								)
						)
					)
			),
			array(
				'title'=>'入驻设置',
				'list'=>array(
					array('type'=>'radio','title'=>'手机端入驻开关','name'=>'switcth','options'=>'selfbuy'),
					array('type'=>'radio','title'=>'显示入驻申请协议','name'=>'open_protocol','options'=>'show'),
					//array('type'=>'switch','title'=>'入驻是否需要入驻金','name'=>'need_schoolfee'),
					//array('type'=>'string','title'=>'入驻金额度','name'=>'schoolfee'),
					array('type'=>'image','title'=>'入驻宣传头部图片','name'=>'regbg'),
					
					)
			),
			array(
				'title'=>'机构端',
				'list'=>array(
					array('type'=>'string','title'=>'机构地址','name'=>'url','read'=>true),
					array('type'=>'image','title'=>'登录页面LOGO','name'=>'loginlogo'),
					array('type'=>'image','title'=>'登录页面宣传图','name'=>'loginbg'),
						
			),
			),
			
			array(
				'title'=>'申请协议',
				'list'=>array(
					array('type'=>'string','title'=>'协议名称','name'=>'applytitle'),
					array('type'=>'text','title'=>'协议内容','name'=>'applycontent'),
					
								
					)
			),
		
		)
	);

	$return['myshop_tpls']=array(
		array('id'=>0,'title'=>'默认风格','image'=>'../addons/jy_chengedu/resource/images/tpl00.png'),
		array('id'=>1,'title'=>'外卖风格','image'=>'../addons/jy_chengedu/resource/images/tpl01.png'),
	);
	$return['is']=array('0'=>'不扣除','1'=>'扣除');
	$return['selfbuy']=array('0'=>'关闭','1'=>'开启');
	$return['show']=array('0'=>'不显示','1'=>'显示');
	$return['commission_types']=$this->commission_types;
	$return['dish_feetypes']=$this->dish_feetypes;
	$return['shop_feetypes']=$this->shop_feetypes;
	$return['no_feetypes']=$this->no_feetypes;
	$return['htmls']=$htmls;
	exi($return);
}


